import employees from '@/assets/constant/employees.js'
export default {
  imgerror: {
    inserted(dom, obj, vnode) {
      dom.src = dom.src || obj.value
      dom.onerror = function() {
        dom.src = obj.value
      }
    },
    componentUpdated(dom, obj) {
      dom.src = dom.src || obj.value
    },
    unbind(dom, obj) {
      dom.onerror = null
    }
  },
  hireType: {
    inserted(dom, obj, vnode) {
      const result = employees.hireType.find((item) => {
        return (item.id = obj.value)
      })
      dom.innerText = result ? result.value : '-'
    },
    componentUpdated(dom, obj) {
      const result = employees.hireType.find((item) => {
        return (item.id = obj.value)
      })
      dom.innerText = result ? result.value : '-'
    }
  }
}
